package com.yunhe.biz;

import java.util.List;
import java.util.Map;

import com.yunhe.dao.GoodsImpl;
import com.yunhe.dao.IGoods;
import com.yunhe.entity.Category;
import com.yunhe.entity.Goods;
import com.yunhe.entity.Supplier;

public class GoodsBizImpl implements IGoodsBiz {

	IGoods ig = new GoodsImpl();
	@Override
	public boolean addGoods(Goods goods, Category category, Supplier supplier) {
		int count = ig.addGoods(goods, category, supplier);
		if(count>0){
			return true;
		}else{
			return false;
		}
	}
	@Override
	public boolean updateGoods(Goods goods, Category category, Supplier supplier) {
		int count = ig.updateGoods(goods, category, supplier);
		if(count>0){
			return true;
		}else{
			return false;
		}
	}
	@Override
	public boolean delGoods(Goods goods) {
		int count = ig.delGoods(goods);
		if(count>0){
			return true;
		}else{
			return false;
		}
	}
	@Override
	public List<Map> getGoodsByPage(int pageIndex, int pageSize) {
		List<Map> map = ig.getGoodsByPage(pageIndex, pageSize);
		return map;
	}
	@Override
	public boolean updateGoodsBygname(Goods goods) {
		int count = ig.updateGoodsBygname(goods);
		if(count>0){
			return true;
		}else{
			return false;
		}
	}
}
